package com.sample.oraclejdbc.controller;

import com.sample.oraclejdbc.domain.Country;
import com.sample.oraclejdbc.repository.CountryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CountryController {

    @Autowired
    private CountryRepository repository;

    @GetMapping("/country/list")
    public List<Country> list() {
        final List<Country> countries = repository.selectList();
        return countries;
    }


}
